#pragma once

#include "bass.h"
#include <stdlib.h>

enum STREAM_TYPE {
	OTHERFILES,
	MOD
};

typedef struct tagStreamNode {
	STREAM_TYPE	idType ;
	char*		sID;
	DWORD		hStream;
} STREAM_NODE, * PSTREAM_NODE;

class SOUND
{
	private:
		char*		m_szFile;
		HWND		m_hWnd;
		int			m_Device;
		DWORD		m_freg;
		DWORD		m_flags;

		PSTREAM_NODE	m_streams;
		int			m_nStreamCount;

	public:
		/// Constructors
		SOUND();
		
		/// Destructor(s)
		~SOUND();

		/// Init
		//int		Init(int nDevice, DWORD freg, DWORD flags);
		int		Init(HWND);

		/// Add file to list
		int		AddFile(STREAM_TYPE type, const char* sID, const char* szFile, DWORD flags);
		/// Remove file from list
		void	RemoveFile(char* id);
		void	RemoveAll();

		/// Play
		int		Play(char* id, bool bRestart);
		/// Pause
		void	Pause(char* id);
		/// Stop
		void	Stop(char* id);
		/// Pause all
		void	PauseAll();
		/// Stop all playing stream
		void	StopAll();
		/// Resume all 
		void	ResumeAll();
		/// Set global volume
		/// 0 - 100
		void	SetGlobalVolume(int nVol);
		/// Se volume for a channel
		// 0 - 100
		void	SetItemVolume(char* id, int nVal);

};

